<?php

use yii\helpers\Html;
use doumiaoduo\layer\LayerConfirmWidget;
use doumiaoduo\layer\LayerIframeWidget;
use common\components\helpers\Fun;

LayerConfirmWidget::widget();
LayerIframeWidget::widget();
?>
<div class="yx-praise-list-box yx-praise-box yx-radius2 zx-min-height">
    <?= $this->renderFile('@app/views/layouts/toolbar.php'); ?>
    <div id="search-area" class="yx-bgf7f7f7 yx-radius5 zx-mg yx-function2 yx-pr0">
        <div style="width:100%;height:40px;">
            <?= Html::beginForm(Fun::url(['customerrelationship/index']), 'get', ['enctype' => 'multipart/form-data']) ?>
            <?= \common\components\helpers\Search::textInput('tel', null, [
                'label' => '会员手机号',
                'labelclass' => 'yx-label',
                'class' => 'search yx-width150 zx-lh24 yx-ml6'
            ]); ?>
            <?= \common\components\helpers\Search::textInput('name', null, [
                'label' => '会员名称',
                'labelclass' => 'yx-label',
                'class' => 'search  yx-width150 zx-lh24 yx-ml6'
            ]); ?>
            <?= \common\components\helpers\Search::dropDownList('category_id', null,
                \yii\helpers\ArrayHelper::map($category, 'id', 'name'),
                [
                    'label' => '意向分类',
                    'promote' => '请选择',
                    'class' => 'search diy_select_txt'
                ]); ?>
            <?= \common\components\helpers\Search::dropDownList('source', null,
                [
                    '1' => '电话', '2' => '地推', '3' => '其他'
                ],
                [
                    'label' => '获客渠道',
                    'promote' => '请选择',
                    'class' => 'search diy_select_txt'
                ]); ?>
            <?= \common\components\helpers\Search::dropDownList('status', null,
                [
                    '0' => '潜在客户', '1' => '意向客户', '2' => '正式VIP'
                ],
                [
                    'label' => '客户类型',
                    'promote' => '请选择',
                    'class' => 'search diy_select_txt'
                ]); ?>
        </div>
        <div>
            <?= \common\components\helpers\Search::submitButton('搜索', ['id' => 'search-handle', 'class' => "yx-search yx-radius2"]); ?>
        </div>
        <?php Html::endForm() ?>
    </div>

    <div class="docs-main zx-mg">
        <table id="tablesaw" class="tablesaw table yx-table1 yx-table3 table-striped with-check"
               data-tablesaw-mode="swipe" data-tablesaw-minimap>
            <thead>
            <tr class="yx-bgd2f6ec">
                <!--<th scope="listorder_input">
                    <?/*= \Yii::t('zhtfrontend', '排序'); */?>
                </th>-->
                <th><?= \Yii::t('zhtfrontend', 'ID'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '姓名'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '性别'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '手机号码'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '意向分类'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '客户状态'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '客户成熟度'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '负责人'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '跟进负责人'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '加入时间'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '来源'); ?></th>
                <th><?= \Yii::t('zhtfrontend', '操作'); ?></th>
            </tr>
            </thead>
            <?php if ($data): ?>
                <?php foreach ($data as $item): ?>
                    <tr data-id="<?= $item['id'] ?>">
                       <!-- <td><?/*= Html::checkbox('ids', false, ['value' => $item['id']]) */?></td>-->
                        <td><?= $item['id'] ?></td>
                        <td><?= $item['name'] ?></td>
                        <td><?= $item['sex'] ?></td>
                        <td><?= $item['mobile'] ?></td>
                        <td><?= $item['category_id'] ?></td>
                        <td><?= $item['status'] ?></td>
                        <td><?= $item['maturity'] ?></td>
                        <td><?= $item['admin_id'] ?></td>
                        <td><?= $item['salesman_id'] ?></td>
                        <td><?= $item['created_at'] ?></td>
                        <td><?= $item['source'] ?></td>
                        <td><?= $item['operate'] ?></td>
                    </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </table>
        <div style="text-align: right"><?= \yii\widgets\LinkPager::widget(['pagination' => $pages]) ?></div>
    </div>
</div>


